#include <stdio.h>
int m = 0;
void Move(int n, char A, char B, char C)
{
    m++;
    if (n == 1) {
        printf("%c -> %c\n", A, C);
    }
    else {
        Move(n - 1, A, C, B);
        printf("%c -> %c\n", A, C);
        Move(n - 1, B, A, C);
    }
}

int main()
{
    int n;
    printf("请输入盘子数：");
    scanf_s("%d", &n);
    Move(n, 'A', 'B', 'C');
    printf("移动次数：%d次", m);
}